export const useAppStore = defineStore("app", () => {
  const _bannerList = uni.getStorageSync("bannerList");
  const bannerList = ref(_bannerList || []);

  const getBannerList = async () => {
    const resp = await uni.request({
      url: "https://hcapi.bbl147.cn/api/v1/wx/file/get_banner",
      method: "POST"
    });
    if (resp.statusCode === 200) {
      bannerList.value = (resp.data as any).data.data;

      uni.setStorageSync("bannerList", bannerList.value);
    }
  };
  return {
    bannerList,
    getBannerList
  };
});
